mytab <- with(airquality,table(OzHi=Ozone>80,Month))
mytab2 <- prop.table(mytab,2)
mytab2 <- addmargins(mytab2,3,1)

DF <- as.data.frame(UCBAdmissions)
mytab3 <- xtabs(Freq~Gender+Admit+Dept,data=DF)
ftable(mytab3)
margin.table(mytab3,1:2)
